package com.tsmti.activiti.service.impl;

import com.tsmti.activiti.dao.ExtendActNodeUserDao;
import com.tsmti.activiti.entity.ExtendActNodeUser;
import com.tsmti.activiti.service.ExtendActNodeUserService;
import com.tsmti.activiti.utils.ActConstants;
import com.tsmti.core.common.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Package：com.tsmti.activiti.service.impl
 * @Class：ExtendActNodeUserServiceImpl
 * @Description： TODO
 * @Author：zcw
 * @Date：Created in 2018/8/16 16:51
 * @Company:
 * @Version：
 * @Modified By:
 *
 */
@Service("extendActNodeuserService")
@Transactional(rollbackFor = Exception.class)
public class ExtendActNodeUserServiceImpl  extends BaseServiceImpl<ExtendActNodeUser> implements ExtendActNodeUserService {
	@Autowired
	private ExtendActNodeUserDao extendActNodeUserDao;

	@Override
	public List<ExtendActNodeUser> getNodeUserByNodeId(String nodeId) {
		return extendActNodeUserDao.getNodeUserByNodeId(nodeId);
	}

	@Override
	public ExtendActNodeUser getNodeUserFieldByNodeId(String nodeId) {
		List<ExtendActNodeUser> actNodeUserList = findByHql("  from ExtendActNodeUser where  nodeId=? and userType=? and delFlag=0",nodeId,ActConstants.ExamineType.BILLUSER.getValue());
		if(actNodeUserList != null && actNodeUserList.size() > 0){
			return actNodeUserList.get(0);
		}
		return null;
	}


}
